#ifndef AVERAGE_H_
#define AVERAGE_H_

#include <Basic.hh>
#include "Mutex.hh"

//
/**
 * \file Average.hh
 * \author  jsk <jsk.jinsubkim@gmail.com>
 * \version 1.0
 *
 * \class Average Average.hh
 *
 * 
 */
class Average
{
public:
	/**
	 * \name Average
	 */
	Average();
	
	/**
	 * \name addData
	 * \param InputData 입력 데이터.
	 * 
	 * 
	 * 
	 * \return 
	 * 
	 * 성공할 경우 RETURN_OK, 
	 * 실패할 경우 RETURN_OK가 아닌 값.
	 */
	virtual ResultOf addData(double InputData);
	
	/**
	 * \name tellAverage
	 * 
	 * 
	 * 
	 * \return 
	 * 
	 * 평균 값.
	 */
	virtual double tellAverage();
	
// Member
protected:
	/**
	 * 평균 값.
	 */
	double AverageVal;
	
	/**
	 * 데이터 개수.
	 */
	USNumber NumOfData;
	
	/**
	 * ???
	 */
	Mutex LockOfAverage;
};

#endif //AVERAGE_H_